﻿using FasterWPF;
using FasterWPFDemo.UserControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace FasterWPFDemo
{
    public partial class TabItem04 : UserControl, IUserControlGuid
    {        
        #region Events

        //SelectionChanged
        void myTreeView_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (e.StillHasItemSelected() && !temporarilyDisableSelectionChanged)
            {
                MessageBox.Show(e.SelectedKey());
            }

            //example to set visited color
            //foreach(Border i in myListBox.Items)
            //{
            //    if (i.Background == Brushes.Turquoise)
            //    {
            //        i.Background = Brushes.Blue;
            //    }
            //}
            //e.SelectedBorder().Background = Brushes.Turquoise;    
        }

        void trv_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            if (!temporarilyDisableSelectionChanged)
            {
                MessageBox.Show("Selected Item Changed " + e.Source.ToString());
            }
        }
 
        #endregion

    }
}
